package com.twu.biblioteca;

public class Copy {

    private enum Status { FREE, RESERVED }

    private String id;
	private ReservableItem item;
	private String owner;
	private Status status;

	public Copy(String id, ReservableItem item) {
		this.id = id;
		this.item = item;
        this.status = Status.FREE;
	}

	public String getId() {
		return id;
	}
	
	public String getOwner(){
		return owner;
	}

    public boolean reserve(String owner){
        if(isFree()){
            this.owner = owner;
            status = Status.RESERVED;
            return true;
        }
        return false;
    }

    public boolean isFree(){
        return (status==Status.FREE);
    }

    public boolean isReserved(){
        return (status==Status.RESERVED);
    }
	

}
